package com.gitee.ywj1352.pservlet;

import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
import java.util.Set;

/**
 * @author: yangwenjie.a
 * @date: 2021/7/5 19:38
 * @description:
 */
public class StartUp implements ServletContainerInitializer {


    @Override
    public void onStartup(Set<Class<?>> set, ServletContext servletContext) throws ServletException {

        // 设置Servlet
        ServletRegistration.Dynamic jndiJDBCServlet =  servletContext.addServlet("p-demo-servlet", PDemoServlet.class);

        jndiJDBCServlet.addMapping("/tables");

        System.out.println("start end");


    }
}
